<?php
// 构造方法也叫构造函数，当实例化对象的时候自动执行
// 练习:js里面构造函数;
class Student{
    private $name;
    private $age;
    public function __construct($name,$age)
    {
        $this->name=$name;
        $this->age=$age;
    }
    public function show()
    {
        echo $this->name;
        echo $this->age;
    }
}

$stu=new Student('lisi',12);
$stu->show()


?>